-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
derive: properly handle generic structs and enums #125
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a test that uses lifetime parameters and lifetimes in the where-clause?
// `Format` bounds for non-native field types | ||
let mut preds = field_types | ||
.into_iter() | ||
.map(|ty| quote!(#ty: defmt::Format)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this creates bounds for each field's type, which is different from what the built-in custom derives are doing (which is adding bounds to each type parameter rust-lang/rust#26925). This is more correct, but I wonder if we should document it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't hurt to document it!
closes #124
suggestions for test cases are welcome